//
//  BindMailBoxVC.m
//  hnGovernment
//
//  Created by 安仔 on 17/3/6.
//  Copyright © 2017年 安仔. All rights reserved.
//

#import "BindMailBoxVC.h"
#import "ChangeView.h"
#import "FinishBindBoxVC.h"
#import "DDbaseNetWork+Login.h"
#import "DDcacheManager.h"
#import "DDHudHelper.h"
#define cacheManager [DDcacheManager shareInstance]

@interface BindMailBoxVC ()<ChangeViewDelegate>

@property (nonatomic, strong) ChangeView *changeView;

@end

@implementation BindMailBoxVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = NSLocalString(@"绑定邮箱");
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.changeView = [[ChangeView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight - 128 * m6Scale)];
    self.changeView.delegate = self;
    [self.view addSubview:self.changeView];
    
}


- (void)clickNextBtn {

    [DDNetWorkManager sendMailCode:self.changeView.phoneTF.text token:[cacheManager userToken] controller:self success:^(id result, DDcacheType cacheType, DDresultType resultType) {
        [DDHudHelper showHudWithResult:result resultSuccess:^{
            FinishBindBoxVC *vc = [[FinishBindBoxVC alloc] init];
            vc.emailStr = self.changeView.phoneTF.text;
            [self.navigationController pushViewController:vc animated:YES];
        }];
    } failure:^(NSError *error) {
    }];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
